Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature kyber for Round 3 Kyber API #327

Merged
merged 27 commits into from
Jun 26, 2024
Merged

Conversation

jschneider-bensch
Copy link
Collaborator

@jschneider-bensch jschneider-bensch commented Jun 20, 2024

This PR fixes #325, by making available kyber{512,768,1024} modules with their own encapsulate and decapsulate behind the kyber feature, in addition to the regular ML-KEM API.
The differences in Kyber compared to ML-KEM are

  • a hash of the initial encapsulation randomness is used instead of using the randomness directly
  • the derivation of the shared secret includes a hash of the ciphertext

c.f. FIPS 203 (Draft), section 1.3.

Further, the hybrid KEMs in libcrux-kem are now available in both variants as well.

@jschneider-bensch jschneider-bensch changed the base branch from main to dev June 20, 2024 08:26
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to figure out how to make eurydice happy here. But I left some comments to be addressed.

libcrux-ml-kem/src/ind_cca/instantiations.rs Show resolved Hide resolved
libcrux-ml-kem/tests/kyber.rs Show resolved Hide resolved
libcrux-ml-kem/tests/kyber.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/tests/kyber.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/src/ind_cca.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/src/ind_cca.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/src/ind_cca.rs Show resolved Hide resolved
libcrux-ml-kem/src/ind_cca.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/tests/kyber.rs Outdated Show resolved Hide resolved
libcrux-ml-kem/src/mlkem1024.rs Show resolved Hide resolved
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change C extraction should work again. Looks like eurydice prefers the trait bounds on the functions. Let's do that for now.

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, lgtm. But we should also update the C code. And it looks like that extraction is broken again 😬

@jschneider-bensch jschneider-bensch enabled auto-merge (squash) June 26, 2024 14:06
@jschneider-bensch jschneider-bensch merged commit 9018f21 into dev Jun 26, 2024
46 checks passed
@jschneider-bensch jschneider-bensch deleted the jonas/xyber768 branch June 26, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Offer Round 3 Kyber API in libcrux-ml-kem
2 participants